home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1996 #15
/
Monster Media Number 15 (Monster Media)(July 1996).ISO
/
os2
/
srefv112.zip
/
USETABL2.RXX
< prev
next >
Wrap
Text File
|
1996-05-10
|
3KB
|
96 lines
/* this is the USETABL2 Rexx-code block, to be called as a
file using the INTERPRET FILE USETABL2.RXX keyphrase.
It is a more sophisticated version of the USE_TABLE code block
(that appears in INTERPET.IN)
You can modify this list by adding "user-agent identifiers" to
the TABLE_LIST and NO_TABLE_LIST stem variables.
*/
/* -- add "table capable browser" User-agent identifiers here -- */
table_list.1='IBM WebExplorer DLL /v1.03' ;
table_list.2="Mozilla/2.0";
table_list.3="Mozilla/1.1";
table_list.4="Mozilla/1.2";
table_list.5="Mozilla/1.3";
table_list.6="IBM-WebExplorer-DLL/v1.1";
table_list.0=6 ;
/* -- add " not table capable browser" User-agent identifiers here -- */
no_table_list.1='IBM WebExplorer DLL /v1.01' ;
no_table_list.2='IBM WebExplorer DLL /v1.00' ;
no_table_list.3="Mozilla/1.0";
no_table_list.0=3 ;
/* -- do not change below here --- */
putme=reqfield("User-Agent") ;
isat=lastpos('.',docname);
docname0=docname ;
if isat>0 then
docname0=delstr(docname,isat) ;
docname1=0 ;
if symbol('optlist.0')='VAR' then do ;
do tmp1z=1 to optlist.0;
parse upper var optlist.tmp1z tmp.1 '=' tmp.2;
if tmp.1="TABLE" & tmp.2="YES" then do;
docname1=docname0||'.TBL' ; leave ; end;
if tmp.1="TABLE" & tmp.2="NO" then do ;
docname1=docname0||'.DEF' ; leave ; end ;
end;
end ;
if docname1=0 then do ;
do smm=1 to table_list.0 ;
if abbrev(translate(putme),translate(table_list.smm))=1 then do;
docname1=docname0||'.TBL' ; leave ;
end ;
end;
end;
if docname1=0 then do ;
do smm=1 to no_table_list.0 ;
if abbrev(translate(putme),translate(no_table_list.smm))=1 then do;
docname1=docname0||'.DEF' ; leave ;
end ;
end;
end;
IF DOCNAME1<>0 THEN do ;
interpret.results=delim_1.1||'INCLUDE '||docname1||delim_2.1 ;
END ;
else do ;
aac='?';
if pos('?',seloriginal)>0 then aac="&" ;
themess="" ;
putme=reqfield("User-Agent");
tmp.1="<html><head><title> Table Version Check </title></head> <body> " ;
tmp.2=" <h2> The requested document contains an optional table </h2> ";
tmp.3=" <br> and our server can't tell whether your browser supports table! ";
tmp.4=" <p> <em> Please select either ..</em> <blockquote>" ;
tmp.5='<p> the <a href="/'||seloriginal||aac||'TABLE=YES"> .. TABLE version </a>' ;
tmp.6='<p> or the <a href="/'||seloriginal||aac||'TABLE=NO"> .. non-table version </a>' ;
tmp.7='</blockquote> of the requested document: ' docname;
tmp.8='<p> Hint: if you see a little table below... your browser <strong>can</strong> handle tables! ' ;
tmp.9="<table border=1><th>Headings <th>Col 1 <th> col 2<th> col 3 " ;
tmp.10="<tr> <td> Row is.. </td> <td> r1 c1 </td <td> r1 c2 </td> ";
tmp.11='<td> r1 c2 </td> <td> last spot </td> </table> ' ;
tmp.12='<hr> FYI: Your browser claims to be :<em>' putme '</em>';
tmp.13="</body></html> ";
themess=tmp.1;
do tmpi=2 to 13 ;
themess=themess||tmp.tmpi ;
end ;
'var type text/html as ' docname ' NAME themess ' ;
exit ;
end ;